package org.daochong.lang;

public class Entry {
	private String key;
	private Object value;

	public Entry() {

	}

	public Entry(String key, Object value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	
	public boolean equals(Object obj) {
		if (obj == null)
			return false;
		if (!(obj instanceof Entry))
			return false;
		Entry other = (Entry) obj;
		if (this.key == null && this.value == null) {
			return other.key == null && other.value == null;
		} else if (this.key == null && this.value != null) {
			return other.key == null && other.value != null;
		} else if (this.key != null && this.value == null) {
			return other.key != null && other.value == null;
		} else {
			return this.key.equals(other.key) && this.value.equals(other.value);
		}
	}

	
	public String toString() {
		return this.getClass().getName() + "(key=" + key + ",value=" + value + ")";
	}
}
